/*
 * Copyright 2019 ThoughtWorks, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
@import "../../global/common";

$global-icon-size:        16px;
$btn-group-border-radius: $global-border-radius;

.btn-icon {
  border:        1px solid $border-color;
  border-radius: $global-border-radius;
  cursor:        pointer;
  font-size:     $global-icon-size;
  padding:       0 10px;
  height:        $form-element-height;
  flex:          0 1 auto;
  color:         $icon-color;
  transition:    $transition;
  background:    $icon-bg;

  &:hover {
    color:      lighten($icon-color, 100%);
    transition: $transition;
    background: $icon-color;
  }

  &:focus, &:active {
    outline: 0;
  }
}

.disabled {
  opacity: 0.75;
  cursor:  not-allowed;

  &:hover {
    color:      $icon-color;
    background: $icon-bg;
  }
}

.enabled {
  cursor: pointer;
}

.settings {
  @include icon-before($type: $fa-var-cog);
}

.analytics {
  @include icon-before($type: $fa-var-bar-chart);
}

.edit {
  @include icon-before($type: $fa-var-pencil-square-o);
}

.view {
  @include icon-before($type: $fa-var-eye);
}

.clone {
  @include icon-before($type: $fa-var-clone);
}

//delete is a keyword, a literal syntax; can't be accessed using styles.delete hence renaming it to remove
.remove {
  @include icon-before($type: $fa-var-trash);
}

.lock {
  @include icon-before($type: $fa-var-lock);
}

.close {
  @include icon-before($type: $fa-var-times);
}

.question {
  @include icon-before($type: $fa-var-question);
}

.check {
  @include icon-before($type: $fa-var-check);
}

.spinner {
  @include icon-before($type: $fa-var-spinner);
  animation: spin 1500ms linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.refresh {
  @include icon-before($type: $fa-var-refresh);
}

.usage {
  @include icon-before($type: $fa-var-pie-chart);
}

.minus {
  @include icon-before($type: $fa-var-minus);
  font-size: 7px;
}

.plus {
  @include icon-before($type: $fa-var-plus);
}

.search {
  @include icon-before($type: $fa-var-search);
}

.info-circle {
  @include icon-before($type: $fa-var-info-circle);
}

.question-circle {
  @include icon-before($type: $fa-var-question-circle);
}

.caret-down {
  @include icon-before($type: $fa-var-caret-down);
}

.caret-right {
  @include icon-before($type: $fa-var-caret-right);
}

.step-forward {
  @include icon-before($type: $fa-var-step-forward);
}

.forward {
  @include icon-before($type: $fa-var-forward);
}

.download {
  @include icon-before($type: $fa-var-download);
}

.chevron-right {
  @include icon-before($type: $fa-var-chevron-right);
}

.chevron-down {
  @include icon-before($type: $fa-var-chevron-down);
}

.chevron-right-round {
  @include icon-before($type: $fa-var-arrow-circle-o-right);
}

.trigger {
  @include icon-before($type: $fa-var-play);
}

.repeat {
  @include icon-before($type: $fa-var-repeat);
}

.comment {
  @include icon-before($type: $fa-var-comment);
}

.warning {
  @include icon-before($type: $fa-var-exclamation-triangle);
}

.angle-double-right {
  @include icon-before($type: $fa-var-angle-double-right);
}

.icon-group {
  border:        1px solid $border-color;
  border-radius: $btn-group-border-radius;
  display:       inline-flex;

  .btn-icon {
    border:        none;
    border-left:   1px solid $border-color;
    border-radius: 0;

    &:first-child {
      border-left:   none;
      border-radius: $btn-group-border-radius 0 0 $btn-group-border-radius;
    }

    &:last-child {
      border-radius: 0 $btn-group-border-radius $btn-group-border-radius 0;
    }
  }
}
